Provably Efficient Non-Preemptive Task Scheduling with Cilk
نویسندگان
چکیده
We consider the problem of scheduling static task graphs by using Cilk, a C-based runtime system for multithreaded parallel programming. We assume no pre-emption of task execution and no prior knowledge of the task execution times. Given a task graph G, the output of the scheduling algorithm is a Cilk program P which, when executed, initiates the tasks in consistence with the precedence requirements of G. We show that the Cilk model has restrictions in implementing optimal schedules for certain types of task graphs; however, the restriction does not fundamentally hinder the practical applications of Cilk, as it is possible to produce reasonably good quality schedules (in the sense of expected execution time). Our algorithm identifies a minimal number of stages, assigns tasks to these stages, and bundles parallel tasks of the same stage into one Cilk procedure. By using Tarjan's algorithm (for set operations) to implement the bundling process, we demonstrate that the parallel schedule can be derived in O(n+e) time for all practical purposes, where n and e denote the number of nodes and edges in the task graph G. With P processors, the expected completion time for the scheduled tasks is bounded by Tp = O(T 1 /P+S), where T 1 denotes the total work, i.e., the time required for executing all tasks on a single processor, and S denotes the sum (over all stages) of the longest execution time of the tasks at each stage. When the execution times of tasks are relatively homogeneous, the quality of the schedule generated by using our approach is nearly optimal. 1 Introduction Task scheduling is one of the most challenging problems in parallel and distributed computing [1]. The scheduling of an arbitrary task graph on arbitrary number of processors is NP-complete [1,6]. We will introduce a sub-optimal approach to perform task scheduling based on Cilk, a provably efficient run-time system for multithreaded programming [2,4]. A set of tasks T will be specified as a strict (irreflexive) partially ordered set (T, <). The relation u < v denotes that the computation of task v depends on the results of the computation of task u, i.e., < specifies precedence constraints. If u < v, u is said to be a predecessor of v, and v a successor of u. The partial order < is conveniently represented as a directed acyclic graph called a task graph. A directed edge (i, j) from …
منابع مشابه
Applying Cilk in Provably Efficient Task Scheduling
We consider the application of Cilk, a C-based runtime system for multithreaded parallel programming, in scheduling static task graphs. We assume no pre-emption of task execution and no prior knowledge of the task execution times. Given a task graph G, the output of the scheduling algorithm is a Cilk program which, when executed, will initiate the tasks in a manner consistent with the precedenc...
متن کاملCost Model: Work, Span and Parallelism
In this class, we will overview various parallel programming technology developed. One of the technology we will examine closely is Cilk, a C/C++ based concurrency platform. Before we overview the development and implementation of Cilk, we shall first overview a brief history of Cilk technology to account for where the major concepts originate. Cilk technology has developed and evolved over mor...
متن کاملProgramming Parallel Applications in
Cilk (pronounced \silk") is a C-based language for multithreaded parallel programming. Cilk makes it easy to program irregular parallel applications, especially as compared with data-parallel or message-passing programming systems. A Cilk programmer need not worry about protocols and load balancing, which are handled by Cilk's provably eecient runtime system. Many regular and irregular Cilk app...
متن کاملExecuting multithreaded programs efficiently
This thesis presents the theory, design, and implementation of Cilk (pronounced “silk”) and Cilk-NOW. Cilk is a C-based language and portable runtime system for programming and executing multithreaded parallel programs. Cilk-NOW is an implementation of the Cilk runtime system that transparently manages resources for parallel programs running on a network of workstations. Cilk is built around a ...
متن کاملPerformance Analysis of the Cilk Locality Runtime
Many parallel programming platforms, such as Cilk Plus, implement a work-stealing scheduler to load-balance parallel computations, since it provides a provably good execution time bound and performs well in practice. However, most work-stealing schedulers, including the Cilk Plus scheduler, do not utilize shared caches and memory efficiently. The Cilk Locality runtime was developed to address t...
متن کامل